/*************************************************************************
 > File Name: monolith/interface/inference/utils.h
 > Author: dzhang
 > Mail: dong.zhang@ingenic.com
 > Created Time : Sun 17 Jan 2021 10:44:28 PM CST
 > Description:
 ************************************************************************/

#ifndef _MONOLITH_INTERFACE_INFERENCE_UTILS_H
#define _MONOLITH_INTERFACE_INFERENCE_UTILS_H
#pragma once
#include "monolith/core/macros.h"
#include <vector>
#include <algorithm>
#include <chrono>
#include <opencv2/opencv.hpp>
#include "monolith/interface/inference/common.h"
CC_NAME_SPACE_BEGIN
namespace inference {

void nms(std::vector<Box> &input, std::vector<Box> &output,
        float iou_threshold = 0.5f, NMSType type = NMSType::hard_nms);

int l2normal(std::vector<float> &data);

float distance(std::vector<float> &a, std::vector<float> &b);

int crop_img(cv::Mat& src_img, cv::Mat& dst_img, int x, int y, int width,
        int height);

int crop_face_img(cv::Mat& src_img, cv::Mat& dst_img, int x, int y, int width,
        int height);

} // namespace inference
CC_NAME_SPACE_END

#endif //MONOLITH_INTERFACE_INFERENCE_UTILS_H
